const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))


Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    addButton:true,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    listConfig: [
      {
        label: "制度名称",
        prop: "riskName",
      
      },
      {
        label: "检查类型",
        prop: "checkType",
        jsonType: typeJson.checkType,
      },
      ],

      slide: {
        slideButton: {
          text: '编辑',
          extClass: 'test',
            src: '/page/weui/cell/icon_star.svg', // icon的路径
        },
        formConfig: [
          {
            label: '制度名称',
            prop: 'riskName',
            required:true,
        },
        {
            label: '隐患分类',
            prop: 'riskType',
            type: 'dropDown',
            jsonType:typeJson.riskTypebase
           
        },
        {
            label: '目的',
            prop: 'dest',
          
        },
          {
            label: '隐患整治工作原则',
            prop: 'workRule',
           
        },
        {
            label: '检查类型',
            prop: 'checkType',
            type: 'dropDown',
            required:true,
            jsonType: typeJson.checkType,
          
        },
         {
            label: '排查治理工作方法',
            prop: 'govenScheme',
           
        },
         {
            label: '整改和上报机制',
            prop: 'reportRule',
           
        },
  
        {
            label: '排查治理内容',
            prop: 'checkContent',
           
        },
     
        {
            label: '附件',
            prop: 'docPath',
            type: 'image',
               
        },
         
          ],
      },
   
 
      formConfig: [
        {
          label: '制度名称',
          prop: 'riskName',
          required:true,
      },
      {
          label: '隐患分类',
          prop: 'riskType',
          type: 'dropDown',
          jsonType:typeJson.riskTypebase
         
      },
      {
          label: '目的',
          prop: 'dest',
        
      },
        {
          label: '隐患整治工作原则',
          prop: 'workRule',
         
      },
      {
          label: '检查类型',
          prop: 'checkType',
          type: 'dropDown',
          required:true,
          jsonType: typeJson.checkType,
        
      },
       {
          label: '排查治理工作方法',
          prop: 'govenScheme',
         
      },
       {
          label: '整改和上报机制',
          prop: 'reportRule',
         
      },

      {
          label: '排查治理内容',
          prop: 'checkContent',
         
      },
   

      {
          label: '附件',
          prop: 'docPath',
          type: 'image',
         
      
      },
       
        
       


     
       
      
        ],
    
        
        net: {
       
            select: {
              url: `/app/riskRule/getList`,
              method: 'post',
              data: {
                mineId: true,
                
              }
            },
            delete: {
              url: '/app/riskRule/delete',
              method: 'get',
              data: {
                
              }
            },
            insert: {
              url: '/app/riskRule/insert',
              method: 'post',
              data: {
                mineId:true,
             
               
              }
            },
            update: {
              url: '/app/riskRule/update',
              method: 'post',
              data: {
  
              }
            }
  
          
        },
        showCom:true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
   
    this.setData({
      showCom: false
    });
    this.setData({
      showCom: true
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})